package com.gqz.patrol.app.entity;

import com.alibaba.fastjson2.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;


/**
 * @ClassName EnPatrolTaskEntity
 * @Description 能源-巡视工单表
 */


@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("T_EN_PATROL_TASK")
public class EnPatrolTaskEntity implements Serializable {

  /**
   * 主键标识
   */
  @TableId
  private String id;

  /**
   * 工单编号
   */
  @TableField(value = "TASK_NO")
  private String taskNo;

  /**
   * 工单名称
   */
  @TableField(value = "TASK_NAME")
  private String taskName;

  /**
   * 运维单位编码
   */
  @TableField(value = "MAINTAIN_UNIT_NO")
  private String maintainUnitNo;

  /**
   * 运维单位
   */
  @TableField(value = "MAINTAIN_UNIT_NAME")
  private String maintainUnitName;

  /**
   * 运维班组编码
   */
  @TableField(value = "MAINTAIN_TEAM_NO")
  private String maintainTeamNo;

  /**
   * 运维班组
   */
  @TableField(value = "MAINTAIN_TEAM_NAME")
  private String maintainTeamName;

  /**
   * 巡视人员编号
   */
  @TableField(value = "PATROL_PERSON_ID")
  private String patrolPersonId;

  /**
   * 巡视人员
   */
  @TableField(value = "PATROL_PERSON_NAME")
  private String patrolPersonName;

  /**
   * 巡视机房编码
   */
  @TableField(value = "PATROL_ROOM_NO")
  private String patrolRoomNo;

  /**
   * 巡视机房
   */
  @TableField(value = "PATROL_ROOM_NAME")
  private String patrolRoomName;

  /**
   * 巡视对象编码s
   */
  @TableField(value = "PATROL_TARGET_NOS")
  private String patrolTargetNos;

  /**
   * 巡视对象s
   */
  @TableField(value = "PATROL_TARGET_NAMES")
  private String patrolTargetNames;

  /**
   * 巡视对象类型编码s
   */
  @TableField(value = "PATROL_TARGET_TYPE_NOS")
  private String patrolTargetTypeNos;

  /**
   * 巡视对象类型s
   */
  @TableField(value = "PATROL_TARGET_TYPE_NAMES")
  private String patrolTargetTypeNames;

  /**
   * 计划开始时间
   */
  @TableField(value = "PLAN_START_TIME")
  @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  @JSONField(name = "planStartTime", format = "yyyy-MM-dd HH:mm:ss")
  private Date planStartTime;

  /**
   * 计划结束时间
   */
  @TableField(value = "PLAN_END_TIME")
  @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  @JSONField(name = "planEndTime", format = "yyyy-MM-dd HH:mm:ss")
  private Date planEndTime;

  /**
   * 巡视内容描述
   */
  @TableField(value = "PATROL_DESCRIPTION")
  private String patrolDescription;

  /**
   * 巡视类型编码
   */
  @TableField(value = "PATROL_TYPE_NO")
  private String patrolTypeNo;

  /**
   * 巡视类型
   */
  @TableField(value = "PATROL_TYPE_NAME")
  private String patrolTypeName;

  /**
   * 工单来源(1.平台2.app)
   */
  @TableField(value = "TASK_SOURCE_NO")
  private String taskSourceNo;

  /**
   * 平台工单状态编码 0-未派单 1-已派单 2-到达现场 3-巡视结束 99-归档
   */
  @TableField(value = "P_TASK_STATUS_NO")
  private String pTaskStatusNo;

  /**
   * 平台工单状态
   */
  @TableField(value = "P_TASK_STATUS_NAME")
  private String pTaskStatusName;

  /**
   * App工单状态编码
   */
  @TableField(value = "A_TASK_STATUS_NO")
  private String aTaskStatusNo;

  /**
   * App工单状态
   */
  @TableField(value = "A_TASK_STATUS_NAME")
  private String aTaskStatusName;

  /**
   * 创建工单人
   */
  @TableField(value = "CREATOR")
  private String creator;
  /**
   * 创建工单人id
   */
  @TableField(value = "CREATOR_BM")
  private String creatorBm;

  /**
   * 创建工单时间
   */
  @TableField(value = "CREAT_TIME")
  @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  @JSONField(name = "creatTime", format = "yyyy-MM-dd HH:mm:ss")
  private Date creatTime;

  /**
   * 派单人编号
   */
  @TableField(value = "SEND_PERSON_ID")
  private String sendPersonId;

  /**
   * 派单人
   */
  @TableField(value = "SEND_PERSON_NAME")
  private String sendPersonName;

  /**
   * 派单人电话
   */
  @TableField(value = "SEND_TEL")
  private String sendTel;

  /**
   * 派单时间
   */
  @TableField(value = "SEND_TIME")
  @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  @JSONField(name = "sendTime", format = "yyyy-MM-dd HH:mm:ss")
  private Date sendTime;

  /**
   * 接单人编号
   */
  @TableField(value = "RECEIVER_ID")
  private String receiverId;

  /**
   * 接单人
   */
  @TableField(value = "RECEIVER")
  private String receiver;

  /**
   * 接单人电话
   */
  @TableField(value = "RECEIVER_TEL")
  private String receiverTel;

  /**
   * 接单时间
   */
  @TableField(value = "RECEIVER_TIME")
  @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  @JSONField(name = "receiverTime", format = "yyyy-MM-dd HH:mm:ss")
  private Date receiverTime;

  /**
   * 接单坐标
   */
  @TableField(value = "RECEIVING_COORDINATE")
  private String receivingCoordinate;

  /**
   * 认证时间
   */
  @TableField(value = "AUTH_TIME")
  @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  @JSONField(name = "authTime", format = "yyyy-MM-dd HH:mm:ss")
  private Date authTime;

  /**
   * 现场描述
   */
  @TableField(value = "SCENE_DESCRIPTION")
  private String sceneDescription;

  /**
   * 现场描述图片IDs
   */
  @TableField(value = "SITE_PICTURE_IDS")
  private String sitePictureIds;

  /**
   * 退单时间
   */
  @TableField(value = "BACK_TIME")
  @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  @JSONField(name = "backTime", format = "yyyy-MM-dd HH:mm:ss")
  private Date backTime;

  /**
   * app结束工单时间
   */
  @TableField(value = "A_END_TIME")
  @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  @JSONField(name = "aEndTime", format = "yyyy-MM-dd HH:mm:ss")
  private Date aEndTime;

  /**
   * app结束工单坐标
   */
  @TableField(value = "A_END_COORDINATE")
  private String aEndCoordinate;

  /**
   * 是否删除 0-否 1-是
   */
  @TableField(value = "IS_DEL")
  private String isDel;

  /**
   * 周期
   */
  @TableField(value = "PERIOD")
  private String period;

  /**
   * 周期截止时间
   */
  @TableField(value = "PERIOD_END_TIME")
  @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  @JSONField(name = "periodEndTime", format = "yyyy-MM-dd HH:mm:ss")
  private Date periodEndTime;

  /**
   * 是否周期产生的工单0-否 1-是
   */
  @TableField(value = "IS_PERIOD")
  private String isPeriod;

  /**
   * 周期工单的源工单
   */
  @TableField(value = "SOURCE_TASK_NO")
  private String sourceTaskNo;

  /**
   * 认证图片IDs
   */
  @TableField(value = "AUTH_PICTURE_IDS")
  private String authPictureIds;

  /**
   * 评价说明
   */
  @TableField(value = "APPRAISE_CONTENT")
  private String appraiseContent;

  /**
   * 评价人id
   */
  @TableField(value = "APPRAISE_PERSON_ID")
  private String appraisePersonId;

  /**
   * 评价人名称
   */
  @TableField(value = "APPRAISE_PERSON_NAME")
  private String appraisePersonName;

  /**
   * 评价时间
   */
  @TableField(value = "APPRAISE_TIME")
  @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  @JSONField(name = "appraiseTime", format = "yyyy-MM-dd HH:mm:ss")
  private Date appraiseTime;

  /**
   * 评价结论 1-合格 2-不合格
   */
  @TableField(value = "APPRAISE_STATUS")
  private String appraiseStatus;

  /**
   * 评价结论 合格 不合格
   */
  @TableField(value = "APPRAISE_STATUS_NAME")
  private String appraiseStatusName;

  /**
   * 巡视结论
   */
  @TableField(value = "PATROL_CONCLUSION")
  private String patrolConclusion;

  /**
   * 是否检查机房卫生
   */
  @TableField(value = "IS_CLEAN")
  private String isClean;

  /**
   * 卫生-机房整体
   */
  @TableField(value = "JF_OVERALL_PICTURE_IDS")
  private String jfOverallPictureIds;

  /**
   * 卫生-机房门口
   */
  @TableField(value = "JF_DOORWAY_PICTURE_IDS")
  private String jfDoorwayPictureIds;

  /**
   * 卫生-主要设备
   */
  @TableField(value = "JF_MAJOR_EQUIP_PICTURE_IDS")
  private String jfMajorEquipPictureIds;

  /**
   * 备注
   */
  @TableField(value = "REMARK")
  private String remark;

  /**
   * 设备是否全选
   */
  @TableField(value = "EQUIPALLSELECT")
  private String equipallselect;

  /**
   * 巡视认证时间
   */
  @TableField(value = "PATROL_TIME")
  @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  @JSONField(name = "patrolTime", format = "yyyy-MM-dd HH:mm:ss")
  private Date patrolTime;

  /**
   * 巡视认证坐标
   */
  @TableField(value = "PATROL_COORDINATE")
  private String patrolCoordinate;

  /**
   * 到达现场人员名称
   */
  @TableField(value = "SCENE_PERSON_NAME")
  private String scenePersonName;

  /**
   * 到达现场人员id
   */
  @TableField(value = "SCENE_PERSON_ID")
  private String scenePersonId;

  /**
   * 到达现场时间
   */
  @TableField(value = "SCENE_TIME")
  @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  @JSONField(name = "sceneTime", format = "yyyy-MM-dd HH:mm:ss")
  private Date sceneTime;

  /**
   * 到达现场坐标
   */
  @TableField(value = "SCENE_COORDINATE")
  private String sceneCoordinate;

  /**
   * 已选设备列表
   */
  @TableField(exist = false)
  private List<EnPatrolTaskEquipEntity> equipList;


  /**
   * start这个是必须要的动态条件集合start   start
   */
  private static Map<String, SFunction<EnPatrolTaskEntity, ?>> map;

  static {
    map = new HashMap<>();
    map.put("id", EnPatrolTaskEntity::getId);
    map.put("taskNo", EnPatrolTaskEntity::getTaskNo);
    map.put("taskName", EnPatrolTaskEntity::getTaskName);
    map.put("maintainUnitNo", EnPatrolTaskEntity::getMaintainUnitNo);
    map.put("maintainUnitName", EnPatrolTaskEntity::getMaintainUnitName);
    map.put("maintainTeamNo", EnPatrolTaskEntity::getMaintainTeamNo);
    map.put("maintainTeamName", EnPatrolTaskEntity::getMaintainTeamName);
    map.put("patrolPersonId", EnPatrolTaskEntity::getPatrolPersonId);
    map.put("patrolPersonName", EnPatrolTaskEntity::getPatrolPersonName);
    map.put("patrolRoomNo", EnPatrolTaskEntity::getPatrolRoomNo);
    map.put("patrolRoomName", EnPatrolTaskEntity::getPatrolRoomName);
    map.put("patrolTargetNos", EnPatrolTaskEntity::getPatrolTargetNos);
    map.put("patrolTargetNames", EnPatrolTaskEntity::getPatrolTargetNames);
    map.put("patrolTargetTypeNos", EnPatrolTaskEntity::getPatrolTargetTypeNos);
    map.put("patrolTargetTypeNames", EnPatrolTaskEntity::getPatrolTargetTypeNames);
    map.put("planStartTime", EnPatrolTaskEntity::getPlanStartTime);
    map.put("planEndTime", EnPatrolTaskEntity::getPlanEndTime);
    map.put("patrolDescription", EnPatrolTaskEntity::getPatrolDescription);
    map.put("patrolTypeNo", EnPatrolTaskEntity::getPatrolTypeNo);
    map.put("patrolTypeName", EnPatrolTaskEntity::getPatrolTypeName);
    map.put("taskSourceNo", EnPatrolTaskEntity::getTaskSourceNo);
    map.put("pTaskStatusNo", EnPatrolTaskEntity::getPTaskStatusNo);
    map.put("pTaskStatusName", EnPatrolTaskEntity::getPTaskStatusName);
    map.put("aTaskStatusNo", EnPatrolTaskEntity::getATaskStatusNo);
    map.put("aTaskStatusName", EnPatrolTaskEntity::getATaskStatusName);
    map.put("creator", EnPatrolTaskEntity::getCreator);
    map.put("creatTime", EnPatrolTaskEntity::getCreatTime);
    map.put("sendPersonId", EnPatrolTaskEntity::getSendPersonId);
    map.put("sendPersonName", EnPatrolTaskEntity::getSendPersonName);
    map.put("sendTel", EnPatrolTaskEntity::getSendTel);
    map.put("sendTime", EnPatrolTaskEntity::getSendTime);
    map.put("receiverId", EnPatrolTaskEntity::getReceiverId);
    map.put("receiver", EnPatrolTaskEntity::getReceiver);
    map.put("receiverTel", EnPatrolTaskEntity::getReceiverTel);
    map.put("receiverTime", EnPatrolTaskEntity::getReceiverTime);
    map.put("receivingCoordinate", EnPatrolTaskEntity::getReceivingCoordinate);
    map.put("authTime", EnPatrolTaskEntity::getAuthTime);
    map.put("sceneDescription", EnPatrolTaskEntity::getSceneDescription);
    map.put("sitePictureIds", EnPatrolTaskEntity::getSitePictureIds);
    map.put("backTime", EnPatrolTaskEntity::getBackTime);
    map.put("aEndTime", EnPatrolTaskEntity::getAEndTime);
    map.put("aEndCoordinate", EnPatrolTaskEntity::getAEndCoordinate);
    map.put("isDel", EnPatrolTaskEntity::getIsDel);
    map.put("period", EnPatrolTaskEntity::getPeriod);
    map.put("periodEndTime", EnPatrolTaskEntity::getPeriodEndTime);
    map.put("isPeriod", EnPatrolTaskEntity::getIsPeriod);
    map.put("sourceTaskNo", EnPatrolTaskEntity::getSourceTaskNo);
    map.put("authPictureIds", EnPatrolTaskEntity::getAuthPictureIds);
    map.put("appraiseContent", EnPatrolTaskEntity::getAppraiseContent);
    map.put("appraisePersonId", EnPatrolTaskEntity::getAppraisePersonId);
    map.put("appraisePersonName", EnPatrolTaskEntity::getAppraisePersonName);
    map.put("appraiseTime", EnPatrolTaskEntity::getAppraiseTime);
    map.put("appraiseStatus", EnPatrolTaskEntity::getAppraiseStatus);
    map.put("appraiseStatusName", EnPatrolTaskEntity::getAppraiseStatusName);
    map.put("patrolConclusion", EnPatrolTaskEntity::getPatrolConclusion);
    map.put("isClean", EnPatrolTaskEntity::getIsClean);
    map.put("jfOverallPictureIds", EnPatrolTaskEntity::getJfOverallPictureIds);
    map.put("jfDoorwayPictureIds", EnPatrolTaskEntity::getJfDoorwayPictureIds);
    map.put("jfMajorEquipPictureIds", EnPatrolTaskEntity::getJfMajorEquipPictureIds);
    map.put("remark", EnPatrolTaskEntity::getRemark);
    map.put("equipallselect", EnPatrolTaskEntity::getEquipallselect);
    map.put("patrolTime", EnPatrolTaskEntity::getPatrolTime);
    map.put("patrolCoordinate", EnPatrolTaskEntity::getPatrolCoordinate);
    map.put("scenePersonName", EnPatrolTaskEntity::getScenePersonName);
    map.put("scenePersonId", EnPatrolTaskEntity::getScenePersonId);
    map.put("sceneTime", EnPatrolTaskEntity::getSceneTime);
    map.put("sceneCoordinate", EnPatrolTaskEntity::getSceneCoordinate);
    map.put("creatorBm", EnPatrolTaskEntity::getCreatorBm);

  }

  public static SFunction<EnPatrolTaskEntity, ?> genColumnSFunction(String column) {
    return map.get(column);
  }
  /** end这个是必须要的动态条件集合end   end */


}
